﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="UploadWhichProduct.ascx.cs" Inherits="UserControl_UploadWhichProduct" %>


<style>
    .which-product-container{
        z-index: 3000;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        padding-top: 40px;
        background-color: rgba(0, 0, 0, 0.45);
    }
    .which-product-content{
        width: 460px;
        padding: 20px 0 20px 0;
        margin: 20px auto;
        border-radius: 6px;
        background-color: #fff;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
    }
    .which-dropdown, #btnWhichProduct{
        display: inline-block;
    }
    .which-dropdown{
        margin: 5px;
    }
    .ddlCategory, .ddlBrand{
        width: 140px;
    }
    .ddlProduct{
        width: 295px;
    }
    #btnWhichProduct{
        height: 85px;
        width: 85px;
    }
    .which-top{
        box-shadow: 0 1px 0.5px 0.5px rgba(0, 0, 0, 0.1);
        border-bottom: 1px solid rgba(0, 0, 0, 0.2);
        margin-bottom: 10px;
        padding-bottom: 5px;
        text-align: center;
    }
    .which-bottom-left{
        width: 330px;
    }
    .which-bottom-right{
        width: 80px;
    }
    .which-bottom-left, .which-bottom-right{
        /*display: inline-block;*/
        float: left;
    }
    .which-top span{
        color: #000000;
        font-size: 16px;
    }
    .which-bottom{
        margin: 20px 20px 0 20px;
        height: 80px;
    }

</style>

<div class="which-product-container">
    <div class="which-product-content">
        <div class="which-top">
            <span>選擇您要分享哪一個商品的UBOX</span>
        </div>
        <div class="which-bottom">
            <div class="which-bottom-left">
                <asp:DropDownList ID="ddlCategory" runat="server" CssClass="form-control input-sm which-dropdown ddlCategory" AutoPostBack="True" DataSourceID="CategoryDataSource" DataTextField="category_name" DataValueField="category_id"></asp:DropDownList>
                <asp:SqlDataSource ID="CategoryDataSource" runat="server" ConnectionString="Data Source=.; Initial Catalog=UBOX; Integrated Security=True" ProviderName="System.Data.SqlClient" SelectCommand="SELECT [category_id], [category_name] FROM [category]"></asp:SqlDataSource>
                <asp:DropDownList ID="ddlBrand" runat="server" CssClass="form-control input-sm which-dropdown ddlBrand" AutoPostBack="True" DataSourceID="BrandDataSource" DataTextField="brand_name" DataValueField="brand_id"></asp:DropDownList>
                <asp:SqlDataSource ID="BrandDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:UBOXConnectionString %>" SelectCommand="SELECT * FROM [brand]"></asp:SqlDataSource>
            
                <asp:DropDownList ID="ddlProduct" runat="server" CssClass="form-control input-sm which-dropdown ddlProduct" DataSourceID="ProductDataSource" DataTextField="product_name" DataValueField="product_id"></asp:DropDownList>
                <asp:SqlDataSource ID="ProductDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:UBOXConnectionString %>" SelectCommand="SELECT [product_id], [product_name] FROM [production_product] WHERE (([brand_id] = @brand_id) AND ([category_id] = @category_id))">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="ddlBrand" Name="brand_id" PropertyName="SelectedValue" Type="Int32" />
                        <asp:ControlParameter ControlID="ddlCategory" Name="category_id" PropertyName="SelectedValue" Type="Int32" />
                    </SelectParameters>
                </asp:SqlDataSource>
            </div>
            <div class="which-bottom-right">
                <button id="btnWhichProduct" type="button" class="btn btn-default">確認</button>
            </div>
        </div>
    </div>
</div>

<script>
    $(function () {
        //var cookies = document.cookie;
        //alert(cookies.split("u_id=")[1]);
    });
</script>